#include <iostream>
#include <algorithm>
#include <string>
#include <cstdio>
using namespace std;
int main( )
{
    int n;
    cin >> n;
    for(int i=1; i<=n; ++i)
    {
        string a, b;
        cin >> a >> b;
        string sa(a), sb(b);

        bool flag = false;
        string out;
        reverse(a.begin(), a.end());
        reverse(b.begin(), b.end());
        int leng;
        if (a.size() > b.size())
        {
            leng = a.size();
            b.append(leng-b.size(), '0');
        }
        else if(a.size() < b.size())
        {
            leng = b.size();
            a.append(leng-a.size(), '0');
        }
        else leng = a.size();


        for(int j=0; j<leng; ++j)
        {
            int ia = a[j]-48, ib = b[j]-48;
            int io = ia + ib;
            if(flag)
                ++io;
            if(io < 10)
            {
                out.push_back((char)io + 48);
                flag = false;
            }
            if(io >= 10)
            {
                out.push_back((char)io + 48 - 10);
                flag = true;
            }
        }
        if(flag) out.push_back('1');
        reverse(out.begin(), out.end());

        printf("Case %d:\n", i);
        cout << sa << " + " << sb << " = " << out << endl;
        if(i < n) cout << endl;
    }
    return 0;
}
/*
2
1 2
112233445566778899 998877665544332211

Case 1:
1 + 2 = 3

Case 2:
112233445566778899 + 998877665544332211 = 1111111111111111110
*/
